package com.es.disped.dao.mapper;

import com.es.disped.dao.model.ClazzStudent;
import com.es.disped.dao.model.ClazzStudentExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

/**
 * @author Anson<br>
 *	Copyright by EasyShare 2019<br>
 *  
 *  All right reserved<br>
 *
 *  Created on 2019年7月27日 下午8:45:14<br>
 *  名称：ClazzStudentMapper.java<br>
 *  描述：班级学生模型<br>
 */
//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface ClazzStudentMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz_student
     *
     * @mbg.generated Sat Jul 06 10:02:10 CST 2019
     */
    @SelectProvider(type=ClazzStudentSqlProvider.class, method="countByExample")
    long countByExample(ClazzStudentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz_student
     *
     * @mbg.generated Sat Jul 06 10:02:10 CST 2019
     */
    @DeleteProvider(type=ClazzStudentSqlProvider.class, method="deleteByExample")
    int deleteByExample(ClazzStudentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz_student
     *
     * @mbg.generated Sat Jul 06 10:02:10 CST 2019
     */
    @Delete({
        "delete from clazz_student",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String relId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz_student
     *
     * @mbg.generated Sat Jul 06 10:02:10 CST 2019
     */
    @Insert({
        "insert into clazz_student (rel_id, clazz_id, ",
        "clazz_name, student_id, ",
        "student_name)",
        "values (#{relId,jdbcType=CHAR}, #{clazzId,jdbcType=CHAR}, ",
        "#{clazzName,jdbcType=VARCHAR}, #{studentId,jdbcType=CHAR}, ",
        "#{studentName,jdbcType=VARCHAR})"
    })
    int insert(ClazzStudent record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz_student
     *
     * @mbg.generated Sat Jul 06 10:02:10 CST 2019
     */
    @InsertProvider(type=ClazzStudentSqlProvider.class, method="insertSelective")
    int insertSelective(ClazzStudent record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz_student
     *
     * @mbg.generated Sat Jul 06 10:02:10 CST 2019
     */
    @SelectProvider(type=ClazzStudentSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="rel_id", property="relId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="clazz_id", property="clazzId", jdbcType=JdbcType.CHAR),
        @Result(column="clazz_name", property="clazzName", jdbcType=JdbcType.VARCHAR),
        @Result(column="student_id", property="studentId", jdbcType=JdbcType.CHAR),
        @Result(column="student_name", property="studentName", jdbcType=JdbcType.VARCHAR)
    })
    List<ClazzStudent> selectByExample(ClazzStudentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz_student
     *
     * @mbg.generated Sat Jul 06 10:02:10 CST 2019
     */
    @Select({
        "select",
        "rel_id, clazz_id, clazz_name, student_id, student_name",
        "from clazz_student",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="rel_id", property="relId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="clazz_id", property="clazzId", jdbcType=JdbcType.CHAR),
        @Result(column="clazz_name", property="clazzName", jdbcType=JdbcType.VARCHAR),
        @Result(column="student_id", property="studentId", jdbcType=JdbcType.CHAR),
        @Result(column="student_name", property="studentName", jdbcType=JdbcType.VARCHAR)
    })
    ClazzStudent selectByPrimaryKey(String relId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz_student
     *
     * @mbg.generated Sat Jul 06 10:02:10 CST 2019
     */
    @UpdateProvider(type=ClazzStudentSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ClazzStudent record, @Param("example") ClazzStudentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz_student
     *
     * @mbg.generated Sat Jul 06 10:02:10 CST 2019
     */
    @UpdateProvider(type=ClazzStudentSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ClazzStudent record, @Param("example") ClazzStudentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz_student
     *
     * @mbg.generated Sat Jul 06 10:02:10 CST 2019
     */
    @UpdateProvider(type=ClazzStudentSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ClazzStudent record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz_student
     *
     * @mbg.generated Sat Jul 06 10:02:10 CST 2019
     */
    @Update({
        "update clazz_student",
        "set clazz_id = #{clazzId,jdbcType=CHAR},",
          "clazz_name = #{clazzName,jdbcType=VARCHAR},",
          "student_id = #{studentId,jdbcType=CHAR},",
          "student_name = #{studentName,jdbcType=VARCHAR}",
        "where rel_id = #{relId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(ClazzStudent record);
}